home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group92c.txt
/
000018_icon-group-sender _Tue Oct 13 11:31:31 1992.msg
< prev
next >
Wrap
Internet Message Format
|
1993-01-04
|
1KB
Received: by cheltenham.cs.arizona.edu; Mon, 19 Oct 1992 11:34:01 MST
Message-Id: <199210131550.AA16871@optima.cs.arizona.edu>
To: icon-group-request@cs.arizona.edu
From: UBY@CU.NIH.GOV
Date: Tue, 13 Oct 1992 11:31:31 EDT
Subject: How to skip comments?
Status: RO
Errors-To: icon-group-errors@cs.arizona.edu
I have been trying to modify the concord.icn program from the Icon program
library to produce cross-reference tables for SAS programs, but I am stumped
about how to skip over comments. Comments in the SAS language are of the form
/* ..... */. I have not been able to figure out how to skip the comments and
still persuade A*B to parse as A and B. The relevent code is appended. Any
suggestions would be greatly appreciated.
Thanks,
Jim Blakley UBY@NIHCU.BITNET
An Icon novice in over his depth
procedure item()
local i, word, line
static char1, sasvar, sas
initial {
char1 := '&%_' ++ &letters
sasvar := char1 ++ &digits
}
while line := read() do {
lineno +:= 1
write(right(lineno, 6), " ", line)
line := map(line) # fold to lowercase
i := 1
line ? {
while tab(upto(sasvar)) do {
word := tab(many(sasvar))
if member(keywords, word) then next # skip reserved words
if word ? any(char1) then suspend word # skip numbers
}
}
}
end